package aor2.components;

import java.util.HashMap;

public class SignalSet {

	private HashMap<String, Signal> signals;

	public boolean add(String name, Signal signal) {
		if (null == get(name)) {
			signals.put(name.toLowerCase(), signal);
			return true;
		}
		return false;
	}

	public boolean add(String name) {
		if (null == get(name)) {
			signals.put(name.toLowerCase(), new Signal(false));
			return true;
		}
		return false;
	}

	public boolean add(String name, boolean active) {
		if (null == get(name)) {
			signals.put(name.toLowerCase(), new Signal(active));
			return true;
		}
		return false;
	}

	public Signal get(String name) {
		return signals.get(name.toLowerCase());
	}

	public SignalSet() {
		signals = new HashMap<String, Signal>();
	}
}
